import React, { Component } from 'react';
import PropTypes from 'prop-types';

import {
    View,
    Text
} from 'react-native';

import styles from './css/index';

export default class TabHeader extends Component {
    static propTypes = {
        title: PropTypes.string, // 对话框标题
        left: PropTypes.object, //左侧导航
        right: PropTypes.object, //右侧导航
    };

    render(){
        return (
            <View style={styles.container}>
                <View style={styles.left}>
                {this.props.left ? 
                    this.props.left
                : null}
                </View>
            {this.props.title ?
                <Text style={styles.title}>{this.props.title}</Text>
            : this.props.children}
                <View style={styles.right}>
                {this.props.right ? 
                    this.props.right
                : null}
                </View>
            </View>
        );
    }
}